
# Base game object
class GameEntity(object):
    def __init__(self, game, name=None):
        self.game = game
        # Auto-add self to game
        self.game.entities.append(self)
        self.enabled = True
        self.idx = game.entity_indices.next()
        if name is None:
            self.name = "game_object_" + str(self.idx)
        else:
            self.name = name
    # Interaction function
    # Note: Derived entities must implement this and
    #       return True only when able to process the
    #       interaction between self and other.
    def interact_with(self, other):
        # No interactions defined
        return False
    # Update called once per tick
    def update(self):
        pass
    def draw(self):
        pass
